<template>
    <div class="icon-container">
      <i class="iconfont" :class="fontClass"></i>
    </div>
  </template>
  
  <script>
  const classMap = {
    home: 'iconzhuye',
    success: 'iconzhengque',
    error: 'iconcuowu',
    close: 'iconguanbi',
    warn: 'iconjinggao',
    info: 'iconxinxi',
    blog: 'iconblog',
    code: 'iconcode',
    about: 'iconset_about_hov',
    weixin: 'iconweixin',
    mail: 'iconmail',
    github: 'icongithub',
    qq: 'iconsign_11',
    arrowUp: 'iconiconfonticonfonti2copy',
    arrowDown: 'iconempty',
    empty: 'iconempty',
    chat: 'iconliuyan'
  }
  export const types = Object.keys(classMap);
  export default {
    props: {
      type: {
        type: String,
        require: true,
      }
    },
    computed: {
      //图标类样式
      fontClass() {
        return classMap[this.type]
      }
    }
  }
  </script>
  
  <style scoped>
  @import "//at.alicdn.com/t/font_2164449_nalfgtq7il.css";
  </style>